/*
 * OrderPanel.java
 *
 * Created on 29.12.2011, 13:16:15
 */
package asbarbeta;

/**
 *
 * @author yasser
 */
public class OrderPanel extends javax.swing.JPanel {
    private final ASBarBetaApp app;
    
    /** Creates new form OrderPanel */
    public OrderPanel(ASBarBetaApp app) {
        this.app = app;
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        OrderNameLabel = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        OrderTextArea = new javax.swing.JTextArea();
        payButton = new javax.swing.JButton();
        cancelButton = new javax.swing.JButton();
        extendOrderButton = new javax.swing.JButton();

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(asbarbeta.ASBarBetaApp.class).getContext().getResourceMap(OrderPanel.class);
        setBackground(resourceMap.getColor("Form.background")); // NOI18N
        setName("Form"); // NOI18N
        setPreferredSize(new java.awt.Dimension(350, 500));

        OrderNameLabel.setFont(resourceMap.getFont("OrderNameLabel.font")); // NOI18N
        OrderNameLabel.setText(resourceMap.getString("OrderNameLabel.text")); // NOI18N
        OrderNameLabel.setName("OrderNameLabel"); // NOI18N

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        OrderTextArea.setColumns(20);
        OrderTextArea.setRows(5);
        OrderTextArea.setName("OrderTextArea"); // NOI18N
        jScrollPane2.setViewportView(OrderTextArea);

        payButton.setText(resourceMap.getString("payButton.text")); // NOI18N
        payButton.setName("payButton"); // NOI18N
        payButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                payButtonActionPerformed(evt);
            }
        });

        cancelButton.setText(resourceMap.getString("cancelButton.text")); // NOI18N
        cancelButton.setName("cancelButton"); // NOI18N
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });

        extendOrderButton.setText(resourceMap.getString("extendOrderButton.text")); // NOI18N
        extendOrderButton.setName("extendOrderButton"); // NOI18N
        extendOrderButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                extendOrderButtonActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(OrderNameLabel)
                    .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 300, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(layout.createSequentialGroup()
                        .add(61, 61, 61)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, extendOrderButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(layout.createSequentialGroup()
                                .add(payButton)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(cancelButton)))))
                .addContainerGap(88, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(OrderNameLabel)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 283, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(59, 59, 59)
                .add(extendOrderButton)
                .add(18, 18, 18)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(cancelButton)
                    .add(payButton))
                .addContainerGap(82, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

private void extendOrderButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_extendOrderButtonActionPerformed
// TODO add your handling code here:
    setVisible(false);
    app.setViewComponent(app.getMenuPanel());
}//GEN-LAST:event_extendOrderButtonActionPerformed

private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
// TODO add your handling code here:
    setVisible(false);
    app.setViewComponent(app.getTablePanel());
}//GEN-LAST:event_cancelButtonActionPerformed

private void payButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_payButtonActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_payButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel OrderNameLabel;
    private javax.swing.JTextArea OrderTextArea;
    private javax.swing.JButton cancelButton;
    private javax.swing.JButton extendOrderButton;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JButton payButton;
    // End of variables declaration//GEN-END:variables
}
